<?php

Class Conexao {

    protected $con = NULL;

    function __construct() {
//        $this->con = mysql_connect($strConexao) or die(mysql_error());
        $this->con = mysql_connect('127.0.0.1:3305','root','123456'); //or die("mysql_error()");
        mysql_select_db("crime");
        
    }

    function executa($query) {
        mysql_query($query);
        return mysql_affected_rows($query);
    }

    function consulta($query) {
        $res = mysql_query($query);
        $resultado = array();
        while ($r = mysql_fetch_object($res)) {
            $resultado[] = $r;
        }
        return $resultado;
    }

}

?>